﻿#ifndef MYTHREAD_H
#define MYTHREAD_H

#include <QObject>
#include <QThread>
#include <QTcpSocket>
#include "CJsonObject.hpp"
#include "cJSON.h"
#include <iostream>
#include <QMutex>

using namespace std;
using namespace neb;
#include "sqlite.h"
class MyThread : public QThread
{
    Q_OBJECT
public:
    MyThread();
    MyThread(QTcpSocket *psocket, QObject *parent );
    ~MyThread();
    void run();
    QTcpSocket *tcp_send_receive;
    QObject *parent;
    Sqlite *sql = Sqlite::getInstance();
    QString word;
signals:
    void sendMsg(QString type,QString username,QString password);

private slots:
    void resiveMsg();
    void deal_sendHistory(QString s);
    void deal_sendreciteWord(QList<QString> list);

private:
    QMutex mutex;
    QList<QString> list;
};

#endif // MYTHREAD_H
